import Vue from 'vue';
import VueRouter from 'vue-router';
Vue.use(VueRouter);

const routes = [
  {
    path: '/',  // 将根路径重定向到 /login
    redirect: '/login'
  },
  {
    path: '/login',
    component: () => import('../view/login/login.vue')
  },

  {
    path: '/register',
    component: () => import('../view/register/register.vue')
  },
  {
    path: '/c',
    component: () => import('../view/container/container.vue'),
    redirect: '/c/market',
    children: [
      {
        path: 'market',
        component: () => import('../view/market/market.vue')
      },
      {
        path: 'consumerblog',
        component: () => import('../view/blog/consumerblog.vue')
      },
       {
        path: 'merchantblog',
        component: () => import('../view/blog/merchantblog.vue')
      },
      {
        path: 'homestay',
        component: () => import('../view/homestay/homestay.vue')
      },
      {
       path: 'bestSelling',
       component: () => import('../view/bestSelling/bestSelling.vue')
     },
     {
      path: 'recommend',
      component: () => import('../view/recommend/recommend.vue')
    }

    ]
  },
  {
    path: '/f',
    component: () => import('../view/container/container2.vue'),
    redirect: '/f/store',
    children: [
      {
        path: 'store',
        component: () => import('../view/store/store.vue')
      },
      {
        path: 'merchantHomeStayInf',
        component: () => import('../view/merchantHomeStayInf/merchantHomeStayInf.vue')
      },
      {
        path: 'merchantmblog',
        component: () => import('../view/merchantmblog/merchantmmblog.vue')
      },

    ]
  }
  


];

const router = new VueRouter({
  mode: 'hash',
  // base: process.env.BASE_URL,
  routes
});

export default router;
